import request from '@/utils/request'

// 获取所有资产渠道
export function listAssetChannel(pageNum,pageSize) {
  return request({
    url: '/channel/listAssetChannel?pageNum='+pageNum+'&pageSize='+pageSize,
    method: 'get'
  })
}


// 复合查询
export function searchAssetChannel(data) {
  return request({
      url: '/channel/searchAssetChannel',
      method: 'get',
      params: data
    })
}

// 新增渠道
export function addAssetChannel(data) {
  return request({
      url: '/channel/addAssetChannel',
      method: 'post',
      data
    })
}

// 查询当前用户信息
//用资金渠道的查找当前用户

// 更新当前渠道状态
export function updateAssetStatus(data) {
  return request({
      url: '/channel/updateAssetStatus/'+data,
      method: 'get'
    })
}


// 查询当前渠道信息
//用资金渠道的查询当前渠道信息

export function getAllRelativeProducts(channelId) {
  return request({
      url: '/channel/getAllRelativeProducts/'+channelId,
      method: 'get',
    })
}


// 更新当前渠道信息
export function updateAssetChannel(data) {
  return request({
      url: '/channel/updateAssetChannel',
      method: 'post',
      data
    })
}


// 查询所有用户信息
//用资金渠道的查询所有用户信息


export function listCapitalProductions(pageNum,pageSize) {
  return request({
      url: '/channel/listCapitalProductions?pageNum='+pageNum+'&pageSize='+pageSize,
      method: 'get',
    })
}


export function addProductToChannel(data) {
  return request({
      url: '/channel/addProductToChannel',
      method: 'post',
      data
    })
}

export function searchRelProduct(data) {
  return request({
      url: '/channel/searchRelProduct',
      method: 'post',
      data
    })
}

export function deleteRelProduct(cpmId) {
  return request({
      url: '/channel/deleteRelProduct/'+cpmId,
      method: 'delete'
    })
}

export function banChannel(channelId) {
  return request({
    url: '/channel/banChannel/'+channelId,
    method: 'get'
  })
}